<div id="clear"></div><div style="position:absolute; right:15px; top:20px; color:#FFF; width:500px;"><?
if(isset($_GET[clearcache])){
	if(!unlink('session\datetime.txt')){echo 'false';}
	exit('<script>alert("清除完成"); location="admin_main.php";</script>');
	}

$count_all_stock = $db->select("SELECT count(sid) as count FROM `".tablepre."stock`");
?>
<div style="float:left;">
<?
if($count_all_stock[0][0]>0){
if(parameters(20)==0){}else{
$check_all_item_in_stock = $db->select("SELECT a.sid FROM `".tablepre."stock_item` a left join `".tablepre."stock` b  on a.sid = b.sid  where b.onsale = 1 and a.quantity < '".parameters(20)."' group by a.sid");
if(count($check_all_item_in_stock)>0){
echo '您有'.count($check_all_item_in_stock).'个库存少于'.parameters(20).'件  <a href="admin_stock_list.php?stock_item">查看</a><br />
';
}
}
}
$order_note = $db->select("SELECT * FROM `".tablepre."order` where situation = 0 order by datetime desc");
if(count($order_note)>0){echo '<a href="admin_order_list.php?action=1">新订单'.count($order_note).'个</a> | ';}
$refund_note = $db->select("SELECT * FROM `".tablepre."order` where paid = 1 and situation = 3 order by datetime desc");
if(count($refund_note)>0){echo '<a href="admin_order_list.php?action=2">退货订单'.count($refund_note).'个</a>';}
?>
</div>
<? if($admin[0][2]==10 or $admin[0][2]==9){?><div style="float:right"><form method="get" action="admin_stock_list.php"><input type="text" name="s_text" value="<? echo $_GET[s_text];?>" /><select name="s_type" style="margin:0 5px; ">

<? 

if(isset($_GET[s_type])){
	echo '<option value="'.$_GET[s_type].'">'; echo eval('echo '.$_GET[s_type].';');  echo '</option>';
	}

?>
  <option value="PRODUCT_NAME"><? echo PRODUCT_NAME;?></option>
  <option value="PRODUCT_MODEL"><? echo PRODUCT_MODEL;?></option>
  <option value="PRODUCT_BATCH_NO"><? echo PRODUCT_BATCH_NO;?></option>
</select><input type="submit" value="<? echo SEARCH_PRODUCT; ?>" /></form></div><? }?></div>
<img style="margin-left:10px; float:left;" src="images/ttfjpg.php?t=分销管理系统&bg=logobg.jpg&z=20&x=5&y=60&r=255&b=255&g=255"  /><ul style="margin:0px; padding:70px 0 0 0;">
<li><a href="admin_main.php">主页</a></li>
<? if($admin[0][2]==10){?>
<li><a href="admin_stock.php">库存分类</a></li>
<li><a href="admin_stock_list.php">商品列表</a></li>
<li><a href="admin_order_list.php?action=1">订单处理</a></li>
<li><a href="?clearcache">清除缓存</a></li>
<? }?>
<li><a href="admin_index.php?out">安全退出</a></li>
</ul>

